package com.yafeed.trade.pojo.dto.stock;

import com.yafeed.trade.common.utils.IdGenerator;
import com.yafeed.trade.entity.leaderstock.LeaderStock;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @description: 领涨股
 * @author: yanghj
 * @time: 2020-12-13 12:29
 */

@Setter
@Getter
@ToString
public class LeaderStockDto implements Serializable {


    private static final long serialVersionUID = -4583240156029541886L;

    /**
     * 主键
     */
    private Long leaderStockId;


    /**
     * 行业主键
     */

    private Long industryId;

    /**
     * 股票编码
     */
    private String stockCode;

    /**
     * 股票名称
     */
    private String stockName;

    /**
     * 行业编码
     */
    private String industryCode;

    /**
     * 当前价格
     */
    private BigDecimal currentPrice;

    /**
     * 涨跌幅（百分比）
     */
    private BigDecimal changeRange;

    /**
     * 涨跌额
     */
    private BigDecimal changeAmount;

    public static LeaderStockDto of() {
        LeaderStockDto leaderStockDto = new LeaderStockDto();
        leaderStockDto.setLeaderStockId(IdGenerator.getGuid());
        return leaderStockDto;
    }

    public LeaderStock toLeaderStock() {
        LeaderStock leaderStock = new LeaderStock();
        BeanUtils.copyProperties(this, leaderStock);
        return leaderStock;
    }


}
